package vacuum.noxray;

import java.util.Stack;

import org.bukkit.entity.Player;

public class UpdateThread extends Thread{

	public Stack<Player> players = new Stack<Player>();
	public boolean run = true;
	public boolean verbose = false;
	public boolean isActuallyOpaque = false;

	public void run(){
		while(run){
			Thread.currentThread().setPriority(MIN_PRIORITY);
			while(players.size() == 0)
				try {
					Thread.sleep(10);
					if(!run)
						return;
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			try{
				new PlayerVision(players.pop(), verbose, isActuallyOpaque).examineVision();
			} catch (Exception ex){
				ex.printStackTrace();
			}
		}
	}
}
